import request from '@/utils/request'

// 金融订单列表page
export function getList(form, pageSize, currentPage) {
  const data = {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  }
  return request.post('/sq/jpManagement/brandDetail/page', data)
}
/**
 * 一级类别
 * @param {*} data
 */
export function getOneList(data) {
  return request.get('/sq/jpManagement/brandLargeCla/upCategory', data)
}
/**
 * 二级类别
 * @param {*} data
 */
export function getTwoList(data) {
  return request.get('/sq/jpManagement/brandLargeCla/upCategoryTo/' + data, data)
}
/**
 * 属性
 * @param {*} data
 */
export function getBrand(data) {
  return request.post('/sq/jpManagement/brandStyle/page', data)
}

/**
 * 新增
 * @param {*} data
 */
export function add(data) {
  return request.post('/sq/jpManagement/brandDetail/save', data)
}
/**
 * 修改
 * @param {*} data
 */
export function update(data) {
  return request.post('/sq/jpManagement/brandDetail/update', data)
}
/**
 * 获取详情
 * @param {*} data
 */
export function getDetails(id) {
  return request.get('/sq/jpManagement/brandDetail/select/' + id)
}
/**
 * 上架 下架
 * @param {*} data
 */
export function changeStatus(data = {}) {
  return request.post('/sq/jpManagement/brandDetail/shelfStatus', data)
}

/**
 * 审核
 * @param {*} data
 */
export function applyCheck(data = {}) {
  return request.post('/sq/jpManagement/brandDetail/check', data)
}
/**
 * 删除
 * @param {*} data
 */
export function deleteQ(id) {
  return request.delete(`/sq/jpManagement/brandDetail/${id}`)
}

// 指定二级类别下的所有已上架的精品上架分页
export function jpOnline(form, pageSize, currentPage) {
  const data = {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  }
  return request.post('/sq/jpManagement/brandDetail/page/online', data)
}

